﻿package gui.hug;

class HUGSquareButton extends Button {
	public var idx : UInt; // Used for Box

	private var w : UInt; // x margin
	private var h : UInt; // y margin

	public function new(label : String, x : Int, y : Int, type : UInt = Button.BLUE_BUTTON) {
		idx = 0;
		w = 0;
		h = 25;
		super(label, x, y, type);
	}

	public function setWidth(val : Int) {
		w = val;
		updateButton();
	}

	public function setHeight(val : Int) {
		h = val;
		updateButton();
	}

	public override function updateButton() {
		switch (bt) {
			case Button.GRAY_BUTTON : 
				upState   = new HUGSquareGrayButtonDS(0, label, w, h);
				overState = new HUGSquareGrayButtonDS(1, label, w, h);
				downState = new HUGSquareGrayButtonDS(2, label, w, h);
			default : 
				upState   = new HUGSquareBlueButtonDS(0, label, w, h);
				overState = new HUGSquareBlueButtonDS(1, label, w, h);
				downState = new HUGSquareBlueButtonDS(2, label, w, h);
		}
		hitTestState = overState;
	}
}
